// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import "fmt"

func sumArray(array [5]int) int {
	sum := 0
	for _, val := range array {
		sum += val
	}
	return sum
}

func main() {
	array := [5]int{6, 6, 6, 6, 6}
	total := sumArray(array)
	fmt.Println(total)
}

//$ go run interview4-1.go
//30
